package com.example.demo.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

//import javax.persistence.EnumType;
//import javax.persistence.Enumerated;


@Data
@ApiModel("书籍")
@TableName("book")
public class Book {

    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty("书籍id")
    private Long bookId;
    @ApiModelProperty("标题")
    private String title;
    @ApiModelProperty("作者")
    private String author;
    @ApiModelProperty("库存")
    private int stock;
    @TableField("status")
    @ApiModelProperty("书籍状态")
    // @Enumerated(EnumType.STRING)  // 明确枚举存储类型
    private BookStatus status;

    @ApiModelProperty("借阅用户")
    private Long borrower;
    @Version
    private Integer version;

    // 无参构造、全参构造
}

